<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>
        甲供件-毛坯件入库单
    </h1>
</section>
<section class="content">
    <div id="printArea" style=" display: none;">
        <div style="padding-bottom: 10px;text-align: center;vertical-align: middle;">
            <div style="font-size: 20px;vertical-align: middle;display: inline-block;font-weight: bold;">机械工程部甲供件-毛坯件入库单
            </div>
        </div>
        <table style="font-size:12px;width: 100%;line-height: 20px;">
            <tr>
                <td width="25%">单据编号：<label id="odrCodePrint" style="font-weight: normal"></label></td>
                <td width="20%">物料分类：<label id="odrMatTypePrint" style="font-weight: normal"></label></td>
                <td width="25%">库房：<label id="odrWhiIdPrint" style="font-weight: normal"></label></td>
                <td width="30%">往来部门：<label id="odrDeptPrint" style="font-weight: normal"></label></td>
            </tr>
            <tr>
                <td>联系方式：<label id="odrServicePersonPrint" style="font-weight: normal"></label></td>
                <td>经手人：<label id="odrTakePersonPrint" style="font-weight: normal"></label></td>
                <td colspan="2">说明：<label id="odrSummaryPrint" style="font-weight: normal"></label></td>
            </tr>
        </table>
        <div id="table-box">
        </div>
        <!--<div style="margin-top: 10px">
            领料人签字：
        </div>-->
    </div>
    <form id="inbillForm" class="form-inline" role="form"
          enctype="multipart/form-data">
        <input type="hidden" id="odrId" th:value="${order.odrId}">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <div class="row">
                            <div class="form-group">
                                <label>单据编号</label>
                                <input type="text" class="form-control"
                                       th:value="${order.odrCode}" readonly="readonly"/>
                            </div>
                            <div class="form-group">
                                <label>往来部门</label>
                                <select id="odrDept" name="odrDept" class="form-control select" disabled="disabled">
                                    <option value="">请选择</option>
                                    <option th:each="type:${dept}" th:value="${type.depId}"
                                            th:text="${type.depName}"
                                            th:selected="${order.odrDept == type.depId}"></option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>经手人</label>
                                <input id="odrChecker" type="text" class="form-control"
                                       th:value="${order.odrChecker}" readonly="readonly"/>

                            </div>
                            <div class="form-group">
                                <label>联系方式</label>
                                <input id="odrServicePerson" type="text" class="form-control"
                                       th:value="${order.odrServicePerson}" readonly="readonly"/>
                            </div>
                            <div class="form-group">
                                <label>说明</label>
                                <input id="odrSummary" type="text" class="form-control" name="" placeholder=""
                                       th:value="${order.odrSummary}" readonly="readonly"/>

                            </div>
                            <div class="form-group">
                                <label>单据类型</label>
                                <select id="odrOutType" class="form-control" name="odrOutType"
                                        disabled="disabled">
                                    <option value="" th:selected="${order.odrOutType == null}">请选择</option>
                                    <option value="1" th:selected="${order.odrOutType == 1}">采购入库</option>
                                    <option value="2" th:selected="${order.odrOutType == 2}">返料入库</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>库位</label>
                                <input type="text" class="form-control" th:value="${order.odaWhiIdName}"readonly="readonly"/>
                            </div>
                            <div class="form-group">
                                <label>物料分类</label>
                                <select id="odaMatType" class="form-control" name="odaMatType"
                                        disabled="disabled">
                                    <option value="" th:selected="${order.odaMatType == null}">请选择</option>
                                    <option value="2" th:selected="${order.odaMatType == 2}">毛坯件</option>
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div id="hot"></div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-md-2">
                                <label>制单人：</label><label th:text="${order.odrTakePerson}"></label>
                            </div>
                            <div class="col-md-6">
                                <label></label>
                            </div>
                            <div class="col-md-4">
                                <div class="col-md-2 col-md-offset-7">
                                    <!--<button type="button" class="btn btn-info file-contract btn-file">打印</button>-->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
<div th:include="include :: footer"></div>
<script th:src="@{/js/jquery.PrintArea.js}"></script>
<script th:inline="javascript">

    $(function () {
        js.get({
            url: ctx + "accountQuery/getInFinish",
            data: {odrId: $('#odrId').val()},
            success: function (result) {
                js.hot.init({
                    element: document.getElementById('hot'),
                    data: result.data,
                    formData: ["odrDept", "odrChecker", "odrServicePerson", "odrSummary", "odrOutType"],
                    colHeaders: ['ID', 'SAP物料编码', '物料描述', '图号', '数量', '单位',  '跟踪号', '项目编号', '项目名称', '部位名称', '合同编号', '供应商',  '外协件类别','区位', '在库类型', '记账日期', '备注'],
                    fieldName: ['odaId', 'odaSapCode', 'odaMatName', 'odaDrawingCode', 'odaNum', 'odaUnit',  'odaTrackCode', 'odaProCode', 'odaProName', 'odaPart',  'contractNo', 'odaSupplier','odaOutsourcedTypeName', 'odaPosition', 'odaStockTypeName', 'odaStorageDate', 'odaRemark'],
                    height: 640,
                    minSpareRows: 100,
                    hiddenColumns: {
                        columns: [0],
                        indicators: true
                    },
                    columns: [
                        {
                            data: 'odaId',
                            type: 'numeric',
                            width: 40
                        },
                        {
                            data: 'odaSapCode',//物料编码
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaMatName',//物料描述
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaDrawingCode',//图号
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaNum',//数量
                            type: 'numeric',
                            readOnly: true
                        },
                        {
                            data: 'odaUnit',//单位
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaTrackCode',//跟踪号
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaProCode',//项目编号
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaProName',//项目名称
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaPart',//部位
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'contractNo',//合同编号
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaSupplier',//供应商
                            type: 'text',
                            readOnly: true
                        },

                        {
                            data: 'odaOutsourcedTypeName',//外协件类别
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaPosition',//区位
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaStockTypeName',//在库类型
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaStorageDate',//入库时间
                            type: 'text',
                            readOnly: true
                        },
                        {
                            data: 'odaRemark',//备注
                            type: 'text',
                            readOnly: true
                        }
                    ]
                })
            }
        })
    })


</script>


</body>
</html>